package com.tekj.cxqcb.view.Module.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tekj.cxqcb.R;
import com.tekj.cxqcb.operation.resultBean.OrderListBean;

import java.util.List;

/**
 * 车辆订单
 */
public class CarOrderAdapter extends BaseQuickAdapter<OrderListBean.DataBean.ListBean, BaseViewHolder> {
    public CarOrderAdapter(@Nullable List<OrderListBean.DataBean.ListBean> data) {
        super(R.layout.item_car_order, data);
    }

    //1进件审批 （审核中）
// 2待进件 可以修改进件  (待补充资料)
// 3代付款
// 4已付款待审批  （待付款）
// 6待提交合同 可以修改合同 (待补充资料)
// 7合同待审批 （审核中）
// 8待提交请款贷款资料 可以修改请款 (待补充资料)
// 9请款资料待审核 （审核中）
// 10提交放款单
// 11风控待审核
// 12待客户提车
// 13订单完成
    @Override
    protected void convert(BaseViewHolder helper, OrderListBean.DataBean.ListBean item) {
        String type = "";
        switch (item.getOrderStatus()) {
            case 1:
                type = "审核中";
                break;
            case 2:
                type = "待补充资料";
                break;
            case 3:
                type = "待付款";
                break;
            case 4:
                type = "待付款";
                break;
            case 5:
//                type = "审核中";
                break;
            case 6:
                type = "待补充资料";
                break;
            case 7:
                type = "审核中";
                break;
            case 8:
                type = "待补充资料";
                break;
            case 9:
                type = "审核中";
                break;
            case 10:
                type = "提交放款单";
                break;
            case 11:
                type = "风控待审核";
                break;
            case 12:
                type = "待客户提车";
                break;
            case 13:
                type = "订单完成";
                break;
        }
        helper.setText(R.id.tv_type, type);
        helper.setText(R.id.tv_name, item.getUserName());
        helper.setText(R.id.tv_dkze, item.getTotalLoanAmount());
        helper.setText(R.id.tv_ygje, item.getMonPay());
        if (item.getOrderDetailList().size() > 0) {
            helper.setText(R.id.tv_car_name, item.getOrderDetailList().get(0).getTitle());
            helper.setText(R.id.tv_ckze, item.getOrderDetailList().get(0).getPlatformPrice());
        } else {
            helper.setText(R.id.tv_car_name, "暂无车辆名称");
            helper.setText(R.id.tv_ckze, "- -");
        }

        helper.setText(R.id.tv_dkqs, "36");
        helper.setText(R.id.tv_time, "创建时间：" + item.getCreateTime());

    }
}
